package UI.BaseModels;

import java.awt.Font;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JButton;

public class ReturnToAdminMenuButton extends JButton {
	
	/**
	 * 
	 */
	private static final long serialVersionUID = 4692175210937903104L;
	/**
	 * All admin panels have an object of this type as their back-button. Has a predefined action listener attached that calls the static method to switch to the admin menu panel.
	 */
	public ReturnToAdminMenuButton() {
	addActionListener(new SwitchToAdminPanel());
	setFont(new Font("Tahoma", Font.PLAIN, 12));
	setBounds(5, 408, 110, 25);
	setText("< Main Menu");
	}
	
	private class SwitchToAdminPanel implements ActionListener {
		public void actionPerformed(ActionEvent arg0) {
			UI.MainFrame.switchToPanel(UI.MainFrame.admin_panel, null);
		}
	}

}
